#include <iostream>
#include <map>
using namespace std;


struct Test{
    int id;

    //With < operator defined as member method.
    bool operator<(const Test& t) const 
    {
        return (this->id < t.id);
    }
};

// bool operator<(const Test& t1 ,const Test& t2)
// {
//     return t1.id < t2.id;
// }




class Log{
   
   Log() = delete;
   public:
      static void Write()
      {
        std::cout << "write \n";
      }
       
};

int main()
{
   Log::Write();
   //Log l; //构造函数不可访问

   Test t1 = { 110 }, t2 = { 102 }, t3 = { 101 }, t4 = { 115 };
   map<Test, int> mymap;

   mymap[t1] = 1;
   mymap[t2] = 2;
   mymap[t3] = 3;
   mymap[t4] = 4;

   for(auto x : mymap)
   {
     cout << x.first.id << " " << x.second << endl;
  }

}
